package com.blue.controller.ai;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.blue.common.entity.ResponseResult;
import com.blue.dto.ai.ChatHistoryDetailDTO;
import com.blue.po.ai.ChatHistoryDetailPO;
import com.blue.service.ai.IChatHistoryDetailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


/**
 * AI聊天历史记录明细表
 *
 * @author cnj
 * @email 15696471158@163.com
 * @date 2024-08-23
 */
@RestController
@RequestMapping("ai/chatHistoryDetail")
@Tag(name = "AI聊天历史记录明细表")
public class ChatHistoryDetailController {
    @Autowired
    private IChatHistoryDetailService chatHistoryDetailService;

    @GetMapping("/list")
    @Operation(summary = "列表查询")
    public ResponseResult<?> list(ChatHistoryDetailDTO requestDTO) {
        List<ChatHistoryDetailPO> chatHistoryDetails = chatHistoryDetailService.list(new LambdaQueryWrapper<ChatHistoryDetailPO>()
                .eq(ChatHistoryDetailPO::getHistoryId, requestDTO.getHistoryId()));
        return ResponseResult.okResult(chatHistoryDetails);
    }
}
